class Cache {
  static final Cache _instance = Cache._internal();
  // ignore: prefer_final_fields
  Map<String, dynamic> _cache = {};

  factory Cache() {
    return _instance;
  }

  Cache._internal() {
    _init();
  }

  void _init() {
    // 初始化缓存或其他设置
  }

  void set(String key, dynamic value) {
    _cache[key] = value;
  }

  dynamic get(String key) {
    var value = _cache[key];
    return value;
  }

  void remove(String key) async {
    _cache.remove(key);
  }

  void clear() async {
    _cache.clear();
  }
}
